package edu.pku.sei.transformation.structure;

import java.util.ArrayList;
import java.util.List;

import edu.pku.sei.mdabase.infrastructure.model.MModelGraph;
import edu.pku.sei.queryscript.parser.Ast.Ast;
import edu.pku.sei.transformation.mtparser.NewExpr;

public class Domain {
	private List<Ast> expressions;
	private List<String> descriptor = new ArrayList<String>();
	
	public void addDescriptor(String desc)
	{
		descriptor.add(desc);
	}
	
	public boolean is(String name)
	{
		if (descriptor == null)
			return false;
		for (String desc : descriptor)
		{
			if (name.equals(desc))
				return true;
		}
		return false;
	}

	public List<Ast> getExpressions(){
		if(expressions==null){
			expressions = new ArrayList<Ast>();
		}
		return expressions;
	}
	
	public void addExpression(Ast ast)
	{
		getExpressions().add(ast);
	}
	
	
	/*
	private MModelGraph model;
	
	public MModelGraph getModel()
	{
		return model;
	}
	
	public void setModel(MModelGraph model)
	{
		this.model = model;
	}
	*/
	
	private Rule owner;

	public Rule getOwner() {
		return owner;
	}

	public void setOwner(Rule owner) {
		this.owner = owner;
	}
}
